/*
 * srm 203 div2 prob 1
 */

import java.util.*;
import java.util.regex.*;
import java.text.*;
import java.math.*;


public class UserName
{
    public String newMember(String[] existingNames, String newName)
    {
	HashSet<String> nameSet = new HashSet<String> ();
	for (String str:existingNames)
	    nameSet.add (str);
	int i = 0;
	while (true) {
	    String s = newName;
	    if (i != 0)
		s += i;
	    if (!nameSet.contains (s))
		return s;
	    ++i;
	}
	/*
	  return null;
	*/
    }
    
    <%:testing-code%>
}
//Powered by KawigiEdit 2.1.4 (beta) modified by pivanof!